<template>
  <div>
    <van-goods-action>
      <van-goods-action-icon
        @click="ifSave = !ifSave"
        :icon="ifSave ? 'star-o' : 'star'"
        :text="ifSave ? '未收藏' : '已收藏'"
        color="#ff5000"
      />
      <van-goods-action-icon icon="cart-o" text="购物车" :badge="badge" />
      <van-goods-action-button type="danger" text="立即购买" @click="onBuy" />
      <van-goods-action-button
        type="warning"
        text="加入购物车"
        @click="showSku"
      />
    </van-goods-action>
  </div>
</template>

<script>
export default {
    props:["badge"],
  data() {
    return {
      ifSave: false,
    };
  },
  methods: {
    onBuy() {
        this.$toast("此功能暂未开放")
    },
    showSku() {
      this.$emit("showSku");
    },
  },
};
</script>

<style scoped lang='less'>
.van-goods-action {
  z-index: 2045;
}
</style>